Skip to content

Keep the shared Java facade compatible with Java 8 - #40

Merged
sambvfx merged 1 commit into
NVIDIAGameWorks:mainfrom
NV-sschneider:codex/java8-shared-facade
Oct 28, 2026
Merged

sambvfx merged 1 commit into
NVIDIAGameWorks:mainfrom
NV-sschneider:codex/java8-shared-facade

Conversation

@NV-sschneider

Copy link
Copy Markdown
Contributor

The shared facade cannot compile on Java 8 because CommandLineRedaction uses records and StringBuilder.repeat. Replace the two record holders with immutable classes and append backslashes in a loop. This is a small prerequisite for reusing the facade from Forge 1.12.2.

Add a regression test that compiles all shared facade sources against the Java 8 platform, with only JOML on the classpath. It runs in the existing test suite. The public facade API and native runtime contract are unchanged.

Validation:

  • gradlew.bat build test: 800 tests passed, no skips.
  • The new test fails against the original implementation; the installed JDK 8 also compiled all 45 facade sources successfully after the fix.
  • tools\rtx.bat check --tests: formatting, lint, types, public-boundary checks, 1,135 tests and 178 subtests passed.
  • tools\rtx.bat launch --resource-pack none --quiet: authenticated Windows x64 Fabric launch; inspected the title screen, confirmed Remix initialization, then quit normally with clean runtime shutdown.

Replace the command-line redactor records with immutable holders and append backslashes without StringBuilder.repeat. Compile every shared facade source against the Java 8 platform in a regression test with only JOML on the classpath.

Signed-off-by: Seth Schneider <74025139+NV-sschneider@users.noreply.github.com>

@sambvfx sambvfx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sambvfx
sambvfx merged commit 779e4e5 into NVIDIAGameWorks:main Oct 28, 2026
2 checks passed
sambvfx pushed a commit that referenced this pull request Oct 28, 2026
Legacy Java clients using LWJGL 2 cannot import Remix's shared images
through the modern Java OpenGL bindings. Add a Windows x64 adapter that
imports color/depth memory and timeline semaphores through WGL,
preserves the client's GL state, and transfers ownership across
composition and presentation.

The adapter has no Minecraft or Forge dependencies. It compiles the
existing shared facade and JNI implementation without changing the
public API, copied C header, or runtime pin. Its native build checks
generated JNI signatures and C layouts; a new Windows CI job runs Java 8
compilation and non-GPU JNI checks. A separate GPU test exercises the
actual image exchange.

Depends on #40. The adapter itself is one commit, 11 files, +1,231 lines
(495 lines of Java/C++ adapter code; the remainder is build,
documentation, and tests). [Review only this
increment](NV-sschneider/rtx-remix-minecraft@codex/java8-shared-facade...codex/legacy-opengl-interop).
This PR targets `main`, so GitHub currently also shows the unmerged Java
8 prerequisite.

Validation:

- `gradlew.bat build test`: 800 tests passed.
- `tools\rtx.bat check --tests`: 1,135 tests and 178 subtests passed;
the committed public-boundary check also passed.
- `forge-1.12.2\scripts\build-bridge.ps1`: actual Java 8, MSVC x64,
generated JNI signatures, ABI layout checks, and `-Xcheck:jni` smoke
passed.
- `build-bridge.ps1 -RuntimeDirectory .\remix-runtime\win64 -GpuSmoke`:
color/depth transfer, 320x240 to 400x300 resize, bidirectional copies,
optional-depth reimport, context/thread guards, GL-state restoration,
and normal process exit passed. Visually inspected both triangle
readbacks.
- `tools\rtx.bat launch --resource-pack none --quiet`: signed-in Windows
x64 Fabric title-screen check, Remix initialization, and normal shutdown
passed.

The GPU test validates runtime-owned presentation. With
application-owned presentation, the pinned runtime's shared images do
not follow window resizing. Window-hang recovery and runtime DLL pinning
are excluded from this change.

---------

Signed-off-by: Seth Schneider <74025139+NV-sschneider@users.noreply.github.com>
sambvfx pushed a commit that referenced this pull request Oct 28, 2026
Add an experimental Windows x64 Forge 1.12.2 module that loads the
shared Remix runtime and presents frames through the legacy OpenGL
adapter. The production module provides installation, initialization,
render-thread lifecycle, `/remix` controls, HUD composition, window
resize, borderless fullscreen, and shutdown. Terrain capture comes in
the next dependent PR.

A separate diagnostic JAR creates a disposable flat world and renders a
lit green panel. It is excluded from the production package. The package
includes the pinned native runtime, verified extraction inventory, JOML
and its license; Minecraft and modpack content are not redistributed.
Windows CI compiles and tests the Forge module and diagnostic source
set.

Depends on #42, which depends on #40. This increment is one commit, 38
files, +2,465/-1 lines, including the official Gradle wrapper,
packaging, documentation, and tests. [Review only this
increment](NV-sschneider/rtx-remix-minecraft@codex/legacy-opengl-interop...codex/forge-bootstrap).
GitHub's full diff also contains the unmerged prerequisites; this draft
should merge after them.

Validation:

- Java 8 `gradlew.bat build test diagnosticJar`: 23 tests passed,
including transformations against the pinned Minecraft bytecode, window
update/fullscreen policy, and runtime extraction.
- `gradlew.bat packageForge`: native bridge checks, payload inventory,
licenses, JOML inclusion, Java 9 metadata exclusion, and diagnostic
exclusion passed.
- Committed public-boundary checks: 24 tests and 18 subtests passed. The
unchanged Fabric baseline also passed the root build/test and signed-in
launch check in #42.
- Installed the packaged JAR and separate diagnostic JAR into a fresh
signed-in Prism instance with Minecraft 1.12.2 and Forge 14.23.5.2860.
Inspected the native panel and Minecraft HUD after 120 rendered frames,
resized 1280x720 to 1024x601, toggled fullscreen and back, switched
Remix off/on, saved to the title screen, and quit normally. Native
shutdown was logged and the process exited. After excluding JOML module
metadata, repeated startup and title-bar shutdown passed without Forge
scanner errors.

This is a bootstrap, not complete gameplay rendering. Terrain, entities,
particles, sky, and native-menu input integration are not included.
Runtime-owned presentation is used because the pinned runtime's
application-owned mode does not resize shared images with the window. No
runtime DLL pinning or window-hang recovery is introduced.

---------

Signed-off-by: Seth Schneider <74025139+NV-sschneider@users.noreply.github.com>
Signed-off-by: Emanuel Kozerski <emanuelkoz.97@hotmail.com>
Co-authored-by: Emanuel Kozerski <emanuelkoz.97@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants